package club.justwill.single.persistence.support;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * Created by luoyu on 15-12-24.
 */
@MappedSuperclass
public class ProjectsBase extends Jpo {

    @Column(name = "user_id")
    private long userId ;

    @Column(name = "title")
    private String title;

    @Column(name = "advantage")
    private String advantage;

    @Column(name = "cover")
    private String cover;

    @Column(name = "name")
    private String name;

    @Column(name = "type")
    private Integer type;

    @Column(name = "financing")
    private Integer financing;

    @Column(name = "max_people")
    private Integer maxPeople;

    @Column(name = "min_people")
    private Integer minPeople;

    @Column(name = "overflow")
    private Integer overflow;

    @Column(name = "end_time")
    private Date endTime;

    @Column(name = "tags")
    private Integer tags;

    @Column(name = "start_money")
    private Integer startMoney;

    @Column(name = "every_max_buy")
    private Integer everyMaxBuy;

    @Column(name = "publish_time")
    private Timestamp publishTime;

    @Column(name = "status")
    private Integer status;

    @Column(name = "province")
    private String province;

    @Column(name = "city")
    private String city;

    @Column(name = "area")
    private String area;

    @Column(name = "model_id")
    private Long modelId;

    @Column(name = "dispatch_time")
    private Date dispatchTime;

    protected void copyBase(ProjectsBase other) {
        setUserId(other.getUserId());
        setTitle(other.getTitle());
        setAdvantage(other.getAdvantage());
        setCover(other.getCover());
        setName(other.getName());
        setType(other.getType());
        setFinancing(other.getFinancing());
        setMaxPeople(other.getMaxPeople());
        setMinPeople(other.getMinPeople());
        setOverflow(other.getOverflow());
        setEndTime(other.getEndTime());
        setTags(other.getTags());
        setStartMoney(other.getStartMoney());
        setEveryMaxBuy(other.getEveryMaxBuy());
        setPublishTime(other.getPublishTime());
        setStatus(other.getStatus());
        setProvince(other.getProvince());
        setCity(other.getCity());
        setArea(other.getArea());
        setModelId(other.getModelId());
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        if(userId == null) {
            this.userId = 0;
        } else {
            this.userId = userId;
        }
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAdvantage() {
        return advantage;
    }

    public void setAdvantage(String advantage) {
        this.advantage = advantage;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getFinancing() {
        return financing;
    }

    public void setFinancing(Integer financing) {
        this.financing = financing;
    }

    public Integer getMaxPeople() {
        return maxPeople;
    }

    public void setMaxPeople(Integer maxPeople) {
        this.maxPeople = maxPeople;
    }

    public Integer getMinPeople() {
        return minPeople;
    }

    public void setMinPeople(Integer minPeople) {
        this.minPeople = minPeople;
    }

    public Integer getOverflow() {
        return overflow;
    }

    public void setOverflow(Integer overflow) {
        this.overflow = overflow;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Integer getTags() {
        return tags;
    }

    public void setTags(Integer tags) {
        this.tags = tags;
    }

    public Integer getStartMoney() {
        return startMoney;
    }

    public void setStartMoney(Integer startMoney) {
        this.startMoney = startMoney;
    }

    public Integer getEveryMaxBuy() {
        return everyMaxBuy;
    }

    public void setEveryMaxBuy(Integer everyMaxBuy) {
        this.everyMaxBuy = everyMaxBuy;
    }

    public Timestamp getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Timestamp publishTime) {
        this.publishTime = publishTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getModelId() {
        return modelId;
    }

    public void setModelId(Long modelId) {
        if(modelId == null) {
            this.modelId = 0L;
        } else {
            this.modelId = modelId;
        }
    }

    public Date getDispatchTime() {
        return dispatchTime;
    }

    public void setDispatchTime(Date dispatchTime) {
        this.dispatchTime = dispatchTime;
    }
}
